package com.dhkj.printlib.entity;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import lombok.Data;

public class ThreePrintVo {
    //打印标题开头
    private String title;
    //订单号
    private String orders;
    private String name;
    //时间
    private String operaTime;
    //操作员
    private String operator;
    //商品小计
    private String count;
    //商品金额合计
    private String amount;
    //底部结束
    private String foot;

    //上期余额
    private String lastPrice;

    //现在余额
    private String nowPrice;

    //消费方式
    private String payType;

    public ThreePrintVo() {
    }

    public ThreePrintVo(String title, String orders, String operaTime, String operator, String count, String amount, String foot) {
        this.title = title;
        this.orders = orders;
        this.operaTime = operaTime;
        this.operator = operator;
        this.count = count;
        this.amount = amount;
        this.foot = foot;
    }

    private List<Foods> foods = new ArrayList<>();

    public ThreePrintVo(String title, String orders, String operaTime, String operator,
                        List<Foods> foods) {
        this.title = title;
        this.orders = orders;
        this.operaTime = operaTime;
        this.operator = operator;
        this.foods = foods;
        this.count = String.valueOf(foods.size());
        BigDecimal amoutBigDec = new BigDecimal(0.0);
        for (Foods goo : foods) {
            amoutBigDec = amoutBigDec.add(new BigDecimal(goo.getAmount()));
        }
        this.amount = amoutBigDec.toEngineeringString();
    }

    public ThreePrintVo(String title, String orders, String operaTime, String operator, String name, String payType,
                        List<Foods> foods) {
        this.title = title;
        this.orders = orders;
        this.operaTime = operaTime;
        this.operator = operator;
        this.foods = foods;
        this.name = name;
        this.count = String.valueOf(foods.size());
        this.payType = payType;
        BigDecimal amoutBigDec = new BigDecimal(0.0);
        for (Foods goo : foods) {
            amoutBigDec = amoutBigDec.add(new BigDecimal(goo.getAmount()));
        }
        this.amount = amoutBigDec.toEngineeringString();
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getOrders() {
        return orders;
    }

    public void setOrders(String orders) {
        this.orders = orders;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getOperaTime() {
        return operaTime;
    }

    public void setOperaTime(String operaTime) {
        this.operaTime = operaTime;
    }

    public String getOperator() {
        return operator;
    }

    public void setOperator(String operator) {
        this.operator = operator;
    }

    public String getCount() {
        return count;
    }

    public void setCount(String count) {
        this.count = count;
    }

    public String getAmount() {
        return amount;
    }

    public void setAmount(String amount) {
        this.amount = amount;
    }

    public String getFoot() {
        return foot;
    }

    public void setFoot(String foot) {
        this.foot = foot;
    }

    public String getLastPrice() {
        return lastPrice;
    }

    public void setLastPrice(String lastPrice) {
        this.lastPrice = lastPrice;
    }

    public String getNowPrice() {
        return nowPrice;
    }

    public void setNowPrice(String nowPrice) {
        this.nowPrice = nowPrice;
    }

    public String getPayType() {
        return payType;
    }

    public void setPayType(String payType) {
        this.payType = payType;
    }

    public List<Foods> getFoods() {
        return foods;
    }

    public void setFoods(List<Foods> foods) {
        this.foods = foods;
    }
}
